a = [1,10,3,8,5,6,7,4,9,2]
n = 10
f = False
try:
    key = int(input("请输入一个查找的数:"))
    if key % 2 == 1:
        i = 0
    else: 
        i = 1
    j = n-1
    f = False
    while i<=j and not f:
        if key % 2 == 0:
            m = (i+j)//2 -((i+j)//2 +1)% 2
        else:
            m = (i+j)//2-(i+j)//2 % 2
        if key == a[m]:
            f = True
        elif key % 2 == 0 and key>a[m] or key % 2 == 1 and key<a[m]:
            j = m-2
        else:
            i = m+2
    if f:
        print(str(m+1))
    else:
        print('不存在')
except:
    print('你输入的不是一个数字！')
